Document processing apparatus and non-transitory computer readable medium storing program

ABSTRACT

A document processing apparatus includes an acquisition unit that acquires, from an electronic document, character information located in an area defined in advance based on a format of the electronic document, and a registration unit that registers the character information acquired by the acquisition unit as attribute information of the electronic document.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/179,118 filed on Nov. 2, 2018 which is based on and claims priorityunder 35 USC 119 from Japanese Patent Application No. 2017-222148 filedNov. 17, 2017. The contents of the above applications are incorporatedherein by reference.

BACKGROUND Technical Field

The present invention relates to a document processing apparatus and anon-transitory computer readable medium storing a program.

Summary

According to an aspect of the invention, there is provided a documentprocessing apparatus including an acquisition unit that acquires, froman electronic document, character information located in an area definedin advance based on a format of the electronic document, and aregistration unit that registers the character information acquired bythe acquisition unit as attribute information of the electronicdocument.

BRIEF DESCRIPTION OF THE DRAWINGS

An exemplary embodiment of the present invention will be described indetail based on the following figures, wherein:

FIG. 1 illustrates the system configuration of a document managementsystem of one exemplary embodiment of the present invention;

FIG. 2 is a block diagram illustrating the hardware configuration of adocument processing apparatus in the exemplary embodiment of the presentinvention;

FIG. 3 is a block diagram illustrating the functional configuration ofthe document processing apparatus in the exemplary embodiment of thepresent invention;

FIG. 4 is a flowchart for illustrating an operation for setting areading range when OCR processing is performed in the documentprocessing apparatus of the exemplary embodiment;

FIG. 5 illustrates an example of a format of “bill”;

FIG. 6 illustrates an example of a display screen on which an electronicdocument is displayed by attribute adding software;

FIG. 7 illustrates an example of a reading range setting screendisplayed when a user selects a tab in order to set an OCR readingrange;

FIG. 8 illustrates a case in which the user selects an area of a previewthat includes date information;

FIG. 9 illustrates an example of a display screen when the user operatesa coordinate button corresponding to a “date” field of attributeinformation while selecting the area including the date information;

FIG. 10 illustrates an example of a screen after the user has selectedOCR reading ranges of “date”, “amount”, and “customer name”;

FIG. 11 illustrates an example of a setting file for reading ranges inwhich the OCR reading ranges are set based on a different type ofcoordinate information;

FIG. 12 illustrates an example of a setting file for reading ranges inwhich characteristic information is set together with the coordinateinformation of the reading range;

FIGS. 13A to 13C illustrate various patterns of character strings to besubjected to OCR reading;

FIG. 14 illustrates an example of a case in which not only informationon a character type but also information on a character direction andthe number of character rows is set as the characteristic informationrelated to characteristics of character information;

FIG. 15 illustrates a situation in which a setting file for readingranges corresponding to a document type of each electronic document isstored in a folder categorized by the document type;

FIG. 16 is a flowchart for illustrating an operation to be performedwhen an electronic document is displayed by the attribute addingsoftware after a setting file for reading ranges has been generated;

FIG. 17 illustrates an example of a display screen when an electronicdocument of a certain bill is displayed by the attribute addingsoftware;

FIGS. 18A to 18C illustrate examples of a case in which the OCRprocessing is not properly performed in a preset OCR reading range; and

FIG. 19 illustrates an example of a display screen for notifying theuser that a reading error has occurred.

DETAILED DESCRIPTION

An exemplary embodiment of the present invention is described in detailwith reference to the drawings.

FIG. 1 illustrates the system configuration of a document managementsystem of one exemplary embodiment of the present invention.

As illustrated in FIG. 1 , the document management system of theexemplary embodiment of the present invention is configurated bydocument processing apparatuses 11 to 13 such as personal computers anda server apparatus 20 that are connected to each other via a network 30.

Document management software is installed in each of the documentprocessing apparatuses 11 to 13. With the document management software,an electronic document file (hereinafter referred to simply as anelectronic document) may be edited or created.

The same document management software is installed in each of thedocument processing apparatuses 11 to 13. Thus, generated electronicdocuments may be transmitted, received, viewed, or revised.

The server apparatus 20 is connected to each of the document processingapparatuses 11 to 13 via the network 30 and is capable of storing datagenerated by each of the document processing apparatuses 11 to 13. Eachof the document processing apparatuses 11 to 13 is capable of readingthe data stored in the server apparatus 20. Thus, the documentprocessing apparatuses 11 to 13 may exchange the electronic documentsvia the server apparatus 20.

The document management software described above includes attributeadding software for adding attribute information to an electronicdocument. The attribute adding software has a function of adding varioustypes of attribute information such as a document type to an electronicdocument and storing the electronic document having the attributeinformation added thereto while categorizing the electronic documentbased on the added attribute information.

The attribute adding software has an OCR function for converting acharacter image into character information represented by charactercodes. When character information is acquired from an electronicdocument obtained by scanning a paper document, OCR processing isperformed on a character image in the electronic document to convert thecharacter image into character information. The character informationmay be registered as attribute information.

When attribute information is added to plural electronic documents, theOCR processing may be executed by specifying areas for each electronicdocument and obtained character information may be registered asattribute information. When this processing is repeated, the operationis cumbersome for a user.

Documents such as a bill or a receipt are often created in predeterminedformats and information such as a customer name or an amount is oftenincluded in a specific area in the electronic document.

Therefore, when character information to be registered as attributeinformation is acquired through the OCR processing from an electronicdocument generated based on a specific format, each of the documentprocessing apparatuses 11 to 13 of this exemplary embodiment performsthe OCR processing on an area defined in advance based on the format toacquire the character information located in that area and registers theacquired character information as the attribute information of theelectronic document.

FIG. 2 illustrates the hardware configuration of the document processingapparatus 11 in the document management system of this exemplaryembodiment. The configurations of the document processing apparatuses 12and 13 are identical to the configuration of the document processingapparatus 11 and description thereof is therefore omitted.

As illustrated in FIG. 2 , the document processing apparatus 11 includesa CPU 21, a memory 22, a communication interface (IF) 23 that transmitsand receives data to and from external apparatuses and the like via thenetwork 30, a storage device 24 such as a hard disk drive (HDD), and auser interface (UI) device 25 including a touch panel or a liquidcrystal display and a keyboard. Those components are connected to eachother via a control bus 26.

The CPU 21 controls an operation of the document processing apparatus 11by executing predetermined processing based on a control program storedin the memory 22 or the storage device 24. This exemplary embodiment isdescribed under the assumption that the CPU 21 reads and executes thecontrol program stored in the memory 22 or the storage device 24. Theprogram may be provided to the CPU 21 by being stored in a storagemedium such as a CD-ROM.

FIG. 3 is a block diagram illustrating the functional configuration ofthe document processing apparatus 11 that is implemented by executingthe control program described above.

As illustrated in FIG. 3 , the document processing apparatus 11 includesan operation receiving part 31, a control part 32, a display part 33, adata storage part 34, a communication part 35, and an OCR processingpart 36.

The operation receiving part 31 receives a setting of a position of anarea where character information to be registered as attributeinformation is acquired from an electronic document.

The OCR processing part 36 performs the OCR processing on an areadefined in advance based on a format of an electronic document such as abill or a receipt, thereby acquiring, from the electronic document,character information located in the area defined in advance based onthe format of the electronic document.

The control part 32 registers the character information acquired by theOCR processing part 36 as attribute information of the electronicdocument.

The display part 33 displays an electronic document and various types ofinformation for the user based on control of the control part 32. Thecommunication part 35 transmits and receives data to and from thedocument processing apparatuses 12 and 13, the server apparatus 20, andthe like via the network 30.

The data storage part 34 stores, as coordinate information, the positionof the area whose setting is received by the operation receiving part31. The data storage part 34 stores, for each type of the attributeinformation, coordinate information of the area where characterinformation is acquired. For example, when items such as a date, anamount, and a customer name are provided as the types of the attributeinformation, the data storage part 34 stores coordinate information ofthe area where character information is acquired for each attributetype.

The data storage part 34 stores characteristic information related tocharacteristics of the attribute information to be acquired.Specifically, the data storage part 34 stores, as the characteristicinformation, information on a character type of the attributeinformation to be acquired, such as information on which of alphabetsand numerals are used.

The data storage part 34 may store, as the characteristic information,information on a character direction or the number of character rows ofthe character information to be acquired for each piece of attributeinformation. Specifically, the data storage part 34 may store, as thecharacteristic information, information on whether the characterinformation to be acquired is arranged vertically or horizontally orwhether the character information is double-row character strings.

The OCR processing part 36 acquires, from an electronic document,character information located in an area indicated by the coordinateinformation stored in the data storage part 34. Further, the OCRprocessing part 36 acquires, from the electronic document, the characterinformation located in the area indicated by the coordinate informationstored in the data storage part 34 for each type of the attributeinformation. When the characteristic information described above isstored in the data storage part 34, the OCR processing part 36 acquires,from the electronic document, character information located in an areadefined in advance based on a format of the electronic document by usingthe characteristic information stored in the data storage part 34.

Specifically, the OCR processing part 36 executes the OCR processing(character recognition processing) by using the information on whetherthe character information to be acquired is alphabets or numerals,whether the character information is arranged vertically orhorizontally, or whether the character information is arranged in pluralrows.

When the character information acquired by the OCR processing part 36from the area defined in advance contradicts the characteristicinformation stored in the data storage part 34, the control part 32notifies the user that the acquired character information is notregistrable as the attribute information.

For example, when the characteristic information stored in the datastorage part 34 includes information related to a character type andwhen the character type of the character information acquired by the OCRprocessing part 36 from the area defined in advance is not identical tothe character type included in the characteristic information stored inthe data storage part 34, the control part 32 notifies the user that theacquired character information is not registrable as the attributeinformation.

When the OCR processing part 36 fails to acquire the characterinformation from the area defined in advance, the control part 32notifies the user that the attribute information is not registrable.

When the attribute information is not properly registered due to thefailure in acquisition of the attribute information or the contradictionbetween the acquired attribute information and the characteristicinformation, the operation receiving part 31 receives again the settingof the position of the area where the information to be registered asthe attribute information is acquired.

The control part 32 is capable of setting in advance whether toautomatically register the character information acquired by the OCRprocessing part 36 as the attribute information of the electronicdocument.

When the setting is made such that the acquired character information isautomatically registered as the attribute information and when theelectronic document is displayed on the display part 33, the controlpart 32 automatically registers the character information acquired bythe OCR processing part 36 as the attribute information of theelectronic document.

Next, an operation to be performed by the document processing apparatus11 of this exemplary embodiment when a character string is acquired froman electronic document displayed by the document management software andis registered as attribute information by the attribute adding softwareis described in detail with reference to the drawings.

First, an operation to be performed when a reading range for the OCRprocessing (OCR reading range) is set by using an electronic documentcreated based on a certain format is described with reference to aflowchart of FIG. 4 .

The following description is directed to a case in which attributeinformation is added to an electronic document of a bill created basedon a format illustrated in FIG. 5 .

The exemplary electronic document of the bill illustrated in FIG. 5 isan electronic document obtained by scanning a paper document of a lettersize (216×279 mm). Date information is provided in an area 51. Amount(billed amount) information is provided in an area 52. Information onthe name of a customer to be billed is provided in an area 53. Thefollowing description is directed to a case in which the areas 51 to 53are set as the OCR reading ranges.

As the coordinate information to be used for setting the OCR readingrange, there is used coordinate information represented by an Xcoordinate in a horizontal direction and a Y coordinate in a verticaldirection with a reference point (0, 0) defined at the upper left end ofthe electronic document.

When the OCR reading range is set by using the electronic documentdescribed above, the control part 32 first causes the display part 33 todisplay the electronic document (Step S101). FIG. 6 illustrates anexample of a display screen on which the electronic document isdisplayed by the attribute adding software.

In the example of the display screen illustrated in FIG. 6 , a previewof the electronic document is displayed on the left and a registrationscreen for registering attribute information, a display screen for imageinformation, and setting screens for user information and registrationinformation are displayed on the right.

When the user selects a tab 61 in order to set the OCR reading range, areading range setting screen is displayed as illustrated in FIG. 7 (StepS102).

The reading range setting screen illustrated in FIG. 7 is a screen onwhich OCR reading ranges for acquiring pieces of attribute informationon types “date”, “amount”, and “customer name” are set in the electronicdocument whose document type is “bill”.

Radio buttons to be used for selecting whether to perform readingsimultaneously with the preview display are displayed on the readingrange setting screen.

When a message “Read simultaneously with preview display” is selected,the OCR processing is executed in the set OCR reading range upondisplaying the preview of the electronic document by the attributeadding software without waiting for a user's reading instruction. Theobtained character information is automatically displayed in an entryfield of each piece of attribute information.

When a message “Do not read simultaneously with preview display” isselected, the preview of the electronic document is displayed by theattribute adding software. In response to the user's readinginstruction, the OCR processing is executed in the set OCR reading rangeand the obtained character information is displayed in the entry fieldof each piece of attribute information.

When the user selects the OCR reading range on the electronic documentdisplayed as a preview by operating a mouse or the like in the readingrange setting screen illustrated in FIG. 7 , coordinates of the readingrange selected by the user are calculated (Step S103).

For example, FIG. 8 illustrates a case in which the user selects an area62 of the preview that includes date information (Step S104).

When the user operates a coordinate button 63 corresponding to a “date”field of attribute information while selecting the area 62 including thedate information as illustrated in FIG. 9 , coordinate information ofthe area 62 is set for the attribute information whose attribute name is“date”. FIG. 9 illustrates a case in which X coordinates and Ycoordinates of a start point and an end point of the area 62 areregistered as the coordinate information.

FIG. 10 illustrates an example of a screen after the user has selectedthe OCR reading ranges of “date”, “amount”, and “customer name”. Theexemplary screen illustrated in FIG. 10 indicates a situation in whichthe areas 62, 65, and 64 are respectively selected as the OCR readingranges of “date”, “amount”, and “customer name”.

When the user finally depresses a “register” button, the control part 32causes the data storage part 34 to store the pieces of coordinateinformation of the areas selected for the pieces of attributeinformation with the individual attribute names as a setting file forOCR reading ranges of the pieces of attribute information with thoseattribute names (Step S105).

When the setting file for OCR reading ranges is stored, the screenreturns to the display screen of the preview of the electronic documentas illustrated in FIG. 6 (Step S106).

The example described above is directed to the case of generating thesetting file in which the X coordinates and the Y coordinates of thestart point and the end point of the OCR reading range of each piece ofattribute information are registered as the coordinate information.Coordinate information illustrated in FIG. 11 may be registered as thesetting file. The setting file for reading ranges illustrated in FIG. 11indicates a case in which information on the horizontal position and thevertical position of the start point of each OCR reading range andinformation on the width and the height of the reading range areregistered as the coordinate information.

A setting file for reading ranges illustrated in FIG. 12 indicates acase in which not only coordinate information of each reading range butalso characteristic information related to characteristics of characterinformation to be acquired from the reading range is registered for eachattribute name. Specifically, in the case of the attribute informationwhose attribute name is “date”, “alphabets” or “numerals” are set as thecharacter type. In the case of the attribute information whose attributename is “amount”, “numerals” are set as the character type. In the caseof the attribute information whose attribute name is “customer name”,“alphabets” are set as the character type.

When the OCR processing part 36 performs the character recognitionprocessing by reading a character image from each OCR reading range toconvert the character image into character codes, the recognitionprocessing is performed by using the characteristic information. Thus,improvement of the recognition rate is expected.

The character string to be subjected to the OCR reading may have variouspatterns. For example, the character string may be not only a simplehorizontal character string as illustrated in FIG. 13A but also avertical character string as illustrated in FIG. 13B or double-rowcharacter strings as illustrated in FIG. 13C.

Therefore, as illustrated in FIG. 14 , not only the information on thecharacter type but also information on a character direction and thenumber of character rows is set as the characteristic informationrelated to the characteristics of the character information for each OCRreading range. Thus, the recognition rate of the recognition processingto be performed by the OCR processing part 36 may be improved comparedwith a case in which the characteristic information is not used.

By storing the setting file for reading ranges described above inassociation with a document type such as “bill” or “receipt”, the OCRreading range corresponding to the document type of the electronicdocument may automatically be set when the electronic document isdisplayed by the attribute adding software.

Even if the setting file for reading ranges is not stored in associationwith the document type, as illustrated in, for example, FIG. 15 , thesetting file for reading ranges corresponding to the document type ofeach electronic document may be stored in a folder categorized by thedocument type. When a certain electronic document is displayed by theattribute adding software, the OCR reading ranges may be set by usingthe setting file in the folder that stores the electronic document.

Next, an operation to be performed when an electronic document isdisplayed by the attribute adding software after a setting file forreading ranges has been generated as described above is described withreference to a flowchart of FIG. 16 .

When an operation is performed so as to display, by the attribute addingsoftware, an electronic document of a document type for which a settingfile for reading ranges has been generated through the operationdescribed above, a preview of the electronic document is displayed (StepS201).

The following description is made under the assumption that the settingis made such that the reading is performed simultaneously with thepreview display. The setting file for reading ranges corresponding tothe document type of the electronic document displayed as a preview isread (Step S202) and coordinate information of each OCR reading range isacquired from the setting file for reading ranges (Step S203). The OCRprocessing part 36 performs the character recognition processing on animage in each area indicated by the acquired coordinate information(Step S204) and the obtained character string information isautomatically displayed in an entry field corresponding to an attributename of each piece of attribute information (Step S205).

For example, FIG. 17 illustrates an example of a display screen when anelectronic document of a certain bill is displayed by the attributeadding software. In the example of the display screen illustrated inFIG. 17 , only by displaying a preview of the electronic document whosedocument type is set to “bill” by the attribute adding software, piecesof character information “Oct. 10, 2017”, “$972.00”, and “DEFCorporation” that are acquired through the OCR processing from presetOCR reading ranges of the preview image are respectively displayed inentry fields of “date”, “amount”, and “customer name” of pieces ofattribute information.

When the user depresses a “register” button 66 in the state in which theacquired pieces of character information are displayed in the entryfields of the respective attribute names of the pieces of attributeinformation, the pieces of character information displayed in the entryfields are registered as the pieces of attribute information of theelectronic document (Step S206).

When a next electronic document is present, the processing of Steps S201to S206 is repeated (“yes” in Step S207). When the addition of attributeinformation to all the electronic documents is completed (“no” in StepS207), the display of the electronic document is terminated (Step S208).

When the OCR processing is properly performed in the preset OCR readingranges, only by displaying the electronic document as illustrated inFIG. 17 , the acquired pieces of character information are displayed inthe entry fields of the respective attribute names of the pieces ofattribute information. There is a case in which the OCR processing isnot properly performed in the preset OCR reading ranges. Processing tobe performed in this case is described with reference to FIG. 18A toFIG. 19 .

When the reading processing is properly performed, the acquiredcharacter information is displayed in the entry field as illustrated inFIG. 18A. When a reading error has occurred because the OCR processingis not properly performed, as illustrated in FIG. 18B and FIG. 18C,information is not displayed in the entry field of the attribute nameand the entry field is displayed in red in order to indicate theoccurrence of the error or an indication that the reading error hasoccurred is displayed in the entry field.

Also in the preview of the electronic document, the set OCR readingrange is displayed in a color indicating the occurrence of the error astypified by a red box. FIG. 18B illustrates a case in which thepositions of the OCR reading range and the character image of theelectronic document deviate from each other. FIG. 18C illustrates a casein which a character image to be subjected to the character recognitionis not present in the OCR reading range.

When the reading error has occurred, as in an example of a displayscreen of FIG. 19 , a notification may be given to the user bydisplaying, on the preview, an indication that the reading error hasoccurred. The exemplary display screen illustrated in FIG. 19 indicatesa case in which the user is notified of the occurrence of the readingerror by displaying a message “‘Customer name’ cannot be read properly!Please set the reading range again!” on the preview while the message issuperposed on the preview.

When the reading error has occurred, the user displays the reading rangesetting screen again and sets the coordinate information again tocorrect the OCR reading range.

The case in which an abnormality occurs in the reading processingincludes not only the cases described above but also a case in which thecharacter type of the character information read through the OCRprocessing is not identical to the character type set for the attributeinformation. Specifically, when the read character information isalphabets though the character type set for the attribute information is“numerals”, the user is notified that an abnormality has occurred in thereading processing. When the read character information is Romannumerals though the character type set for the attribute information is“numerals”, the read Roman numerals may be converted into Arabicnumerals and displayed while attracting user's attention by changing thecolor of the entry field of the attribute information into yellow or thelike.

Also when the coordinate information in the setting file for readingranges falls out of a range of a paper size, the user is notified thatthe reading processing is not properly executable so as to prompt theuser to set the reading range again.

The foregoing description of the exemplary embodiment of the presentinvention has been provided for the purposes of illustration anddescription. It is not intended to be exhaustive or to limit theinvention to the precise forms disclosed. Obviously, many modificationsand variations will be apparent to practitioners skilled in the art. Theembodiment was chosen and described in order to best explain theprinciples of the invention and its practical applications, therebyenabling others skilled in the art to understand the invention forvarious embodiments and with the various modifications as are suited tothe particular use contemplated. It is intended that the scope of theinvention be defined by the following claims and their equivalents.

What is claimed is:
 1. A document processing apparatus, comprising: ascanner configured to capture a document and create a scanned electronicdocument corresponding to the document; the document processingapparatus configured with a memory and processor, programmed to performthe following: store in the memory in advance a format of the scannedelectronic document, the format of the scanned electronic documentincluding for each of a plurality of character information data fields,comprising: (i) a character direction of the character information, and(ii) a number of character rows of the character information; acquirefrom the scanned electronic document, character information using atleast the character direction and number of character rows from theformat stored in memory in advance; and if the document processingapparatus is able to acquire the character information, register theacquired character information as attribute information of theelectronic document, and if the document processing apparatus is notable to acquire the character information, alert a user that theattribute information is not registrable.